package models;

import java.util.ArrayList;
import java.util.LinkedList;
import java.util.Date;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.OneToMany;

import org.hibernate.annotations.Cascade;

import play.db.jpa.Model;

@Entity
public class Contract extends Model {
	public String name1;
	public String name2;
	public String mobile1;
	public String mobile2;
	public String phone1;
	public String phone2;
	public String area;
	public long contract_id;
	public int year;
	public Date date;
	public String address;
	public String floor_type;
	
	@OneToMany(cascade=CascadeType.ALL,mappedBy = "contract" )
	public List<Product> productList;

	@OneToMany(cascade=CascadeType.ALL,mappedBy = "contract")
	public List<CarReturnReport> reportList;

	
	
	
	public Contract(String name1, String name2, String mobile1, String mobile2,
			String phone1, String phone2, String area, long contract_id,
			int year, Date date, String address, String floor_type,
			ArrayList<Product> pl) {

		this.name1 = name1;
		this.name2 = name2;
		this.mobile1 = mobile1;
		this.mobile2 = mobile2;
		this.phone1 = phone1;
		this.phone2 = phone2;
		this.area = area;
		this.contract_id = contract_id;
		this.year = year;
		this.date = date;
		this.address = address;
		this.floor_type = floor_type;
		this.productList = pl;
	}




}
